<?php if (empty($post)): ?>
<div class="alert">
	<button type="button" class="close" data-dismiss="alert">&times;</button>
	<strong>啊哦！</strong>内容不存在，或者已被删除！
</div>
<?php else: ?>
<script type="text/javascript" src="<?=base_url('assets/js/holder.js')?>"></script>
<script type="text/javascript" src="<?=base_url('assets/js/Chart.min.js')?>"></script>
<script type="text/javascript">page.page_info.is_voted=<?=$is_voted ? 'true' : 'false'?>;</script>
<div class="hero-unit"  data-pid="<?=$post['id']?>">
	<h1><?=htmlspecialchars($post['title'])?>，这正常吗？</h1>
	<p>回复数：<?=$post['comment_count']?></p>
	<?php if ($post['is_anonymous'] == 1): ?>
	<div>由匿名用户发布在 <a href="<?=site_url("category/{$category['id']}_1.html")?>"><?=$category['name']?></a> </div>
	<?php else: ?>
	<div>由 <a href="<?=site_url("user/{$author['id']}")?>"><?=$author['name']?></a> 发布在 <a href="<?=site_url("category/{$category['id']}_1.html")?>"><?=$category['name']?></a> </div>
	<?php endif; ?>
	<div>正常：<?=sprintf("%.2f%%", calc_rate($post['c1_count'], $post['c2_count']) * 100)?></div>
	<p><?=nl2br($post['detail'])?></p>
	<div id="vote-result"></div>
	<div class="vote-actions">
		<button type="button" class="btn btn-large btn-success" data-cnum="1">是丫，这很正常～</button>
		<button type="button" class="btn btn-large btn-danger" data-cnum="2">次奥，太变态了！</button>
	</div>
</div>
<div id="alert-no-comment" class="alert"><strong>啊哦！</strong>还没有评论哦！赶紧来抢沙发吧！</div>
<div id="comment-panel" class="well"><?=$comment_tree_html?></div>
<form id="form-post-comment" action="<?=site_url('post/add_comment')?>" method="post">
	<fieldset>
		<div class="err-board"></div>
		<input type="hidden" name="post_id" value="<?=$post['id']?>" />
		<div class="control-group">
			<label class="control-label" for="content">我的评论</label>
			<div class="controls">
				<textarea id="content" name="content" class="input-block-level" rows="10" placeholder="我来说两句"></textarea>
			</div>
		</div>
		<div class="form-actions">
			<button type="submit" class="btn btn-primary" data-loading-text="正在发布...">发表评论</button>
		</div>
	</fieldset>
</form>
<div id="dlg-post-comment-reply" class="modal hide fade">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3>回复</h3>
	</div>
	<div class="modal-body">
		<form action="<?=site_url('post/add_comment')?>" method="post">
		<fieldset>
			<div class="err-board"></div>
			<input type="hidden" name="post_id" value="<?=$post['id']?>" />
			<input type="hidden" name="reply_id" value="" />
			<div class="control-group">
				<label class="control-label" for="content">我的回复</label>
				<div class="controls">
					<textarea id="content" name="content" class="input-block-level" rows="10" placeholder="我的回复"></textarea>
				</div>
			</div>
		</fieldset>
	</form>
	</div>
	<div class="modal-footer">
		<button class="btn btn-primary">回复</button>
		<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
	</div>
</div>
<?php endif; ?>